#include <iostream>
#include <cstring>
using namespace std;

class String
{
    char *str;
    // class  默认 private
public:
    // 构造函数
    String(const char *p)
    {
        cout << "构造函数运行啦" << endl;
        int len = std::strlen(p);
        str = new char[len + 1];
        for (int i = 0; i < len; i++)
        {
            str[i] = p[i];
        }
    }
    // 析构函数
    ~String()
    {
        cout << "做一些清理工作" << endl;
        delete[] str;
    }
};
int main()
{
    String s1("111");
}
